<template>
    <div style="padding: 20px 40px;height:100%;background-color:#f4f7fa ">
        <!-- <div style="padding: 20px 40px"> -->
        <el-steps :active="1" align-center>
            <el-step title="填写分色申请"></el-step>
            <el-step title="审核分色申请"></el-step>
            <el-step title="创建分色计划"></el-step>
            <el-step title="开始作业"></el-step>
            <el-step title="分色完成"></el-step>
        </el-steps>
        <div style="display:flex;justify-content:start;margin-bottom:12px;position: relative;">
            <el-button type="primary" size="mini" :loading="this.sepLoading" v-if="orderItem.dataSource != '2'"
                       @click="cretedDataInfo(0)">保存
            </el-button>
            <el-button type="primary" size="mini" :loading="this.sepLoading" v-if="orderItem.dataSource != '2'"
                       @click="cretedDataInfo(1)">保存并提交
            </el-button>
            <el-button style="position: absolute;right:0" type="primary" size="mini" @click="backToCancel">返回
            </el-button>
        </div>
        <el-card>
            <div>
                <div style="display: flex;justify-content:space-between">
                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem">仓库</div>
                        <div style="width:70%">
                            <el-input :value="wareList.filter(item => item.id == this.$props.menuActiveName)[0].whName"
                                      size="mini" disabled placeholder=""></el-input>
                        </div>
                    </div>
                    <div style="display: flex;width:20%">
                        <div class="titolItem" style="width:60px">分色类型</div>
                        <div style="width:70%">
                            <el-select v-model="setPlan" placeholder="请选择" size="mini" @change="setPlanChange"
                                       :disabled="menuActiveName == 36">
                                <el-option
                                    v-for="item in setPlanList"
                                    :key="item.value"
                                    :label="item.lable"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div style="display: flex; width:20%">
                        <div class="titolItem" style="width:60px">货权方</div>
                        <el-select
                            v-model="selectCustomer"
                            :disabled="!$utils.getUserInfo().currentAgentPermission"
                            filterable size="mini"
                            @change="onChangeCustomer"
                        >
                            <el-option
                                v-for="item in customerInfoList"
                                :key="item.customerPartyID"
                                :value="item.customerPartyCode"
                                :label="item.customerPartyName"
                            />
                        </el-select>
                    </div>

                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem">备注</div>
                        <div style="width:70%">
                            <el-input v-model="remark" size="mini" placeholder="请输入备注"></el-input>
                        </div>
                    </div>
                </div>
            </div>
            <div v-if="setPlan == '60'">
                <div style="display: flex;justify-content:space-between;margin-top:10px">
                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem" style="width:90px;position:relative">预计提货时间<span
                            style="color:red;position: absolute;left:-10px">*</span></div>
                        <div style="width:70%">
                            <el-date-picker
                                v-model="outEstimateDate"
                                size="mini"
                                type="date"
                                placeholder="选择日期">
                            </el-date-picker>
                        </div>
                    </div>
                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem" style="width:60px">提货车号</div>
                        <div style="width:70%">
                            <el-input v-model="outCarNo" size="mini" placeholder="请输入提货车号"></el-input>
                        </div>
                    </div>
                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem" style="width:60px">提货司机</div>
                        <div style="width:70%">
                            <el-input v-model="outDriver" size="mini" placeholder="请输入提货司机"></el-input>
                        </div>
                    </div>
                    <div style="display: flex;justify-content:start;width:20%">
                        <div class="titolItem" style="width:90px">司机联系方式</div>
                        <div style="width:70%">
                            <el-input v-model="outTel" size="mini" placeholder="请输入司机联系方式"></el-input>
                        </div>
                    </div>
                </div>
            </div>
            <el-button style="margin:10px 30px 0" type="primary" size="mini" @click="sepPlanXZ">选择分色数据</el-button>
            <el-dialog
                :visible.sync="dialogVisible"
                width="80%"
                height="80%"
                :before-close="handleClose">
                <div v-if="menuActiveName == 27" style="margin-top:-65px">
                    <div style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">选择分色数据</div>
                    <el-table
                        :data="tableInfo"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '3px'}"
                        :height="300"
                        style="width: 100%">
                        <el-table-column align="center" type="index" width="50"/>
                        <el-table-column
                            v-for="item in cloumns"
                            align="center"
                            :key="item.prop"
                            :prop="item.prop"
                            :fixed="item.fixed"
                            :label="item.label"
                            :width="item.width">
                            <el-table-column :width="item.width" v-if="item.type" :prop="item.prop" align="center"
                                             :formatter="item.formatter">
                                <template slot="header" slot-scope="scope">
                                    <Input
                                        v-if="item.prop === 'batchAttr07'"
                                        v-model="searchTableData['batchAttr07']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['settlementCustomer']" size="mini"
                                               placeholder="请选择结算客户" v-if="item.prop === 'settlementCustomerName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in customerList"
                                            :key="item.customerId"
                                            :label="item.settlementCustomerName"
                                            :value="item.settlementCustomer">
                                        </el-option>
                                    </el-select>
                                    <Input
                                        v-if="item.prop === 'matName'"
                                        v-model="searchTableData['matName']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['matTypCode']" size="mini"
                                               placeholder="" v-if="item.prop === 'matTypName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in categoryList"
                                            :key="item.id"
                                            :label="item.dictName"
                                            :value="item.dictValue">
                                        </el-option>
                                    </el-select>
                                    <el-select clearable v-model="searchTableData['goodsBondedProperty']" size="mini"
                                               placeholder="" v-if="item.prop === 'goodsBondedProperty'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in goodsBondedPropertyList"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                        </el-table-column>
                        <el-table-column fixed="right" align="center" label="操作" width="70">
                            <template slot-scope="scope">
                                <el-button type="text" size="mini" v-if="scope.row.availableQty > 0"
                                           @click="tcTableInfoCreated(scope.row, scope.$index)"><span
                                    style="color:#5c68ee">添加</span></el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <Page style="margin-top:10px" :total="total" size="small" show-elevator show-sizer
                          @on-change="Pagechange" @on-page-size-change="pageSizeChange"
                          :current="this.getSepInfoData.pageNum " :page-size="this.getSepInfoData.pageSize"></Page>
                    <p style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">所选数据</p>
                    <el-table
                        :data="activeTableList"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '5px'}"
                        :height="250"
                        style="width: 100%">
                        <el-table-column type="index" align="center" width="50"/>
                        <el-table-column
                            v-for="item in cloumnsTwo"
                            :key="item.prop"
                            align="center"
                            :fixed="item.prop == 'operation' || item.prop ==  'totalQty'|| item.prop ==  'availableQty'?'right' : false"
                            :prop="item.prop"
                            :label="item.label"
                            :width="item.width">
                            <template slot-scope="scope">
                                <div v-if="item.type == 'operation'">
                                    <el-button type="text" size="mini"
                                               @click="deleteItem(scope.$index, activeTableList,true,scope.row)"><span
                                        style="color:#5c68ee">删除</span></el-button>
                                </div>
                                <div v-else-if="item.type == 'date'">
                                    {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                </div>
                                <div v-else-if="item.type == 'isOne'">
                                    {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                </div>
                                <div v-else>
                                    {{ scope.row[item.prop] }}
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="menuActiveName == 26 || menuActiveName == 37" style="margin-top:-65px">
                    <div style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">选择分色数据</div>
                    <el-table
                        :data="tableInfo"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '3px'}"
                        :height="300"
                        style="width: 100%">
                        <el-table-column type="index" align="center" width="50"/>
                        <el-table-column
                            v-for="item in cloumnsTJ"
                            :key="item.prop"
                            align="center"
                            :fixed="item.type == 'operation' || item.prop ==  'totalQty'||item.prop ==  'availableQty' ? 'right': false"
                            :prop="item.prop"
                            :label="item.label"
                            :width="item.width">
                            <el-table-column :width="item.width" v-if="item.type" align="center" :prop="item.prop"
                                             :formatter="item.formatter">
                                <template slot="header" slot-scope="scope">
                                    <Input
                                        v-if="item.prop === 'batchAttr07'"
                                        v-model="searchTableData['batchAttr07']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['settlementCustomer']" size="mini"
                                               placeholder="请选择结算客户" v-if="item.prop === 'settlementCustomerName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in customerList"
                                            :key="item.id"
                                            :label="item.settlementCustomerName"
                                            :value="item.settlementCustomer">
                                        </el-option>
                                    </el-select>
                                    <Input
                                        v-if="item.prop === 'matName'"
                                        v-model="searchTableData['matName']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['matTypCode']" size="mini"
                                               placeholder="" v-if="item.prop === 'matTypName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in categoryList"
                                            :key="item.id"
                                            :label="item.dictName"
                                            :value="item.dictValue">
                                        </el-option>
                                    </el-select>
                                    <el-select clearable v-model="searchTableData['goodsBondedProperty']" size="mini"
                                               placeholder="" v-if="item.prop === 'goodsBondedProperty'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in goodsBondedPropertyList"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                        </el-table-column>
                        <el-table-column fixed="right" align="center" label="操作" width="70">
                            <template slot-scope="scope">
                                <el-button type="text" size="mini" v-if="scope.row.availableQty > 0"
                                           @click="tcTableInfoCreated(scope.row, scope.$index)"><span
                                    style="color:#5c68ee">添加</span></el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <Page style="margin-top:10px" :total="total" size="small" show-elevator show-sizer
                          @on-change="Pagechange" @on-page-size-change="pageSizeChange"
                          :current="this.getSepInfoData.pageNum" :page-size="this.getSepInfoData.pageSize"></Page>
                    <p style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">所选数据</p>
                    <el-table
                        :data="activeTableList"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '5px'}"
                        :height="250"
                        style="width: 100%">
                        <el-table-column type="index" align="center" width="50"/>
                        <el-table-column
                            v-for="item in cloumnsTwoTJ"
                            align="center"
                            :fixed="item.prop == 'operation' || item.prop ==  'totalQty'|| item.prop ==  'availableQty'?'right' : false"
                            :key="item.prop"
                            :prop="item.prop"
                            :label="item.label"
                            :width="item.width">
                            <template slot-scope="scope">
                                <div v-if="item.type == 'operation'">
                                    <el-button type="text" size="mini"
                                               @click="deleteItem(scope.$index,activeTableList,true,scope.row)"><span
                                        style="color:#5c68ee">删除</span></el-button>
                                </div>
                                <div v-else-if="item.type == 'date'">
                                    {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                </div>
                                <div v-else-if="item.type == 'isOne'">
                                    {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                </div>
                                <div v-else>
                                    {{ scope.row[item.prop] }}
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="menuActiveName == 36" style="margin-top:-65px">
                    <div style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">选择分色数据</div>
                    <el-table
                        :data="tableInfo"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '3px'}"
                        :height="300"
                        style="width: 100%">
                        <el-table-column type="index" align="center" width="50"/>
                        <el-table-column
                            v-for="item in cloumns"
                            :key="item.prop"
                            align="center"
                            :fixed="item.type == 'operation' || item.prop ==  'totalQty'||item.prop ==  'availableQty' ? 'right': false"
                            :prop="item.prop"
                            :label="item.label"
                            :width="item.width">
                            <el-table-column :width="item.width" v-if="item.type" align="center" :prop="item.prop"
                                             :formatter="item.formatter">
                                <template slot="header" slot-scope="scope">
                                    <Input
                                        v-if="item.prop === 'batchAttr07'"
                                        v-model="searchTableData['batchAttr07']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['settlementCustomer']" size="mini"
                                               placeholder="请选择结算客户" v-if="item.prop === 'settlementCustomerName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in customerList"
                                            :key="item.id"
                                            :label="item.settlementCustomerName"
                                            :value="item.settlementCustomer">
                                        </el-option>
                                    </el-select>
                                    <Input
                                        v-if="item.prop === 'matName'"
                                        v-model="searchTableData['matName']"
                                        size="mini"
                                        placeholder="输入关键字搜索"
                                        @on-enter="getStockListByCCisCustomerCode"/>
                                    <el-select clearable v-model="searchTableData['matTypCode']" size="mini"
                                               placeholder="" v-if="item.prop === 'matTypName'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in categoryList"
                                            :key="item.id"
                                            :label="item.dictName"
                                            :value="item.dictValue">
                                        </el-option>
                                    </el-select>
                                    <el-select clearable v-model="searchTableData['goodsBondedProperty']" size="mini"
                                               placeholder="" v-if="item.prop === 'goodsBondedProperty'"
                                               @change="getStockListByCCisCustomerCode">
                                        <el-option
                                            v-for="item in goodsBondedPropertyList"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                        </el-table-column>
                        <el-table-column fixed="right" align="center" label="操作" width="70">
                            <template slot-scope="scope">
                                <el-button type="text" size="mini" v-if="scope.row.availableQty > 0"
                                           @click="tcTableInfoCreated(scope.row, scope.$index)"><span
                                    style="color:#5c68ee">添加</span></el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                    <Page style="margin-top:10px" :total="total" size="small" show-elevator show-sizer
                          @on-change="Pagechange" @on-page-size-change="pageSizeChange"
                          :current="this.getSepInfoData.pageNum " :page-size="this.getSepInfoData.pageSize"></Page>
                    <p style="margin-top:20px;font-size:14px;margin-bottom:10px;font-weight:700">所选数据</p>
                    <el-table
                        :data="activeTableList"
                        :header-cell-style="{'font-weight': 300,'color': '#111',background:'rgb(242,245,249)',padding: '5px'}"
                        :height="250"
                        style="width: 100%">
                        <el-table-column type="index" align="center" width="50"/>
                        <el-table-column
                            v-for="item in cloumnsTwo"
                            align="center"
                            :fixed="item.prop == 'operation' || item.prop ==  'totalQty'|| item.prop ==  'availableQty'?'right' : false"
                            :key="item.prop"
                            :prop="item.prop"
                            :label="item.label"
                            :width="item.width">
                            <template slot-scope="scope">
                                <div v-if="item.type == 'operation'">
                                    <el-button type="text" size="mini"
                                               @click="deleteItem(scope.$index,activeTableList,true,scope.row)"><span
                                        style="color:#5c68ee">删除</span></el-button>
                                </div>
                                <div v-else-if="item.type == 'date'">
                                    {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                </div>
                                <div v-else-if="item.type == 'isOne'">
                                    {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                </div>
                                <div v-else>
                                    {{ scope.row[item.prop] }}
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <span slot="footer" class="dialog-footer">
                    <Button type="text" style="color: #000;" @click="cancelInfo">取消</Button>
                    <Button type="primary" class="btn-warning" @click="confirmInfo">确定</Button>
                </span>
            </el-dialog>
        </el-card>
        <div style="height:10px"></div>
        <el-card v-if="setPlan == '61' && menuActiveName == 27" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApply.billOfLandingNo }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            :data="keys.ccisSeparationApplyParents"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tcCloumnDtail"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tcCloumnDtailX"
                                align="center"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <div v-if="item.prop == 'codeQty'">
                                            <el-input
                                                v-model.number='scope.row[item.prop]'
                                                :disabled="scope.row['ifCodeReading'] == '0' || !scope.row['ifCodeReading']"
                                                size="mini"
                                                type='number'
                                                :placeholder="'请输入'+ item.label"
                                                maxLength='9'
                                            />
                                        </div>
                                        <div v-else>
                                            <el-input
                                                v-model.number='scope.row[item.prop]'
                                                size="mini"
                                                type='number'
                                                @change="inputChange(scope.row, item.prop)"
                                                :placeholder="'请输入'+ item.label"
                                                maxLength='9'
                                            />
                                        </div>
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="packingSpecificatClick($event, scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'packFormat'"
                                                   size="mini" placeholder="请选择规格">
                                            <el-option
                                                v-for="busi in hwGoodsList"
                                                :key="busi.id"
                                                :label="busi.packName"
                                                :value="busi.packFormat">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1"
                                                     @change="boxChange($event, item, scope.row)"
                                                     false-label="0"></el-checkbox>
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
        </el-card>
        <el-card v-if="setPlan == '61' && (menuActiveName == 26 || menuActiveName == 37)" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApplyParents[0].batchAttr08 }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :data="keys.ccisSeparationApplyParents"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tjCloumnDtail"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'" style="font-weight:300">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tjCloumnDtailX"
                                align="center"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :prop="item.prop"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-if="item.prop == 'codeQty'"
                                            :disabled="scope.row['ifCodeReading'] != '1'"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            type='number'
                                            maxLength='9'
                                        />
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-else
                                            @change="inputChange(scope.row, item.prop)"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            type='number'
                                            maxLength='9'
                                        />
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="changesMatCode($event,scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matPack'"
                                                   size="mini" placeholder="请选择规格">
                                            <el-option
                                                v-for="busi in packingSpecificationList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1" false-label="0"
                                                     @change="boxChange($event,item,scope.row)"></el-checkbox>
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
        </el-card>
        <el-card v-if="setPlan == '61' && menuActiveName == 36" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApplyParents[0].batchAttr08 }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :data="keys.ccisSeparationApplyParents"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in shCloumnDtail"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'" style="font-weight:300">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in shCloumnDtailX"
                                align="center"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :prop="item.prop"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <el-input
                                            v-model='scope.row[item.prop]'
                                            v-if="item.prop == 'codeQty'"
                                            :disabled="scope.row['ifCodeReading'] != '1'"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            @change="inputChange(scope.row, item.prop)"
                                        />
                                        <el-input
                                            v-model='scope.row[item.prop]'
                                            v-else
                                            @change="inputChange(scope.row, item.prop)"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                        />
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="changesMatCode($event,scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'packFormat'"
                                                   size="mini" placeholder="请选择规格" filterable>
                                            <el-option
                                                v-for="busi in hwGoodsList"
                                                :key="busi.id"
                                                :label="busi.packName"
                                                :value="busi.packFormat">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1" false-label="0"
                                                     @change="boxChange($event,item,scope.row)"></el-checkbox>
                                    </div>
                                    <div v-else>
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <el-dialog
                        :visible.sync="sTargetColorSeparationData"
                        width="80%"
                        height="80%"
                        title="请选择目标分色数据"
                        :before-close="handleClose">
                        <el-input v-model="matName" size="mini" placeholder="根据品名模糊查询" style="width:200px"></el-input>
                        <el-select v-model="cargoName" disabled placeholder="" size="mini">
                            <el-option>
                            </el-option>
                        </el-select>
                        <el-button type="primary" size="mini" @click="searchS(keys)" style="margin-left:10px">查询
                        </el-button>
                        <el-button type="primary" size="mini" @click="resetS(keys)">重置</el-button>
                        <el-table
                            :data="sColorSeparationData"
                            :height="300"
                            style="width: 100%"
                            @selection-change="sColorSeparationSelectHandler">
                            <el-table-column align="center" type="selection" width="80"></el-table-column>
                            <el-table-column align="center" type="index" width="80" label="编号"/>
                            <el-table-column
                                v-for="item in sCloumns"
                                align="center"
                                :key="item.prop"
                                :prop="item.prop"
                                :fixed="item.fixed"
                                :label="item.label"
                                :width="item.width">
                            </el-table-column>
                        </el-table>
                        <span slot="footer" class="dialog-footer" style="margin-bottom:10px">
                            <el-button @click="sTargetColorSeparationData = false" size="mini"
                                       style="float:right;position:relative;bottom:9px;right:40px">取 消</el-button>
                            <el-button type="primary" @click="selectColorTrueHandler(keys)" size="mini"
                                       style="float:right;position:relative;bottom:9px;right:60px">确 定</el-button>
                        </span>
                    </el-dialog>
                </div>
            </div>
        </el-card>
        <el-card v-if="setPlan == '60' && menuActiveName == 27" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApply.billOfLandingNo }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :data="keys.ccisSeparationApplyParents"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tcCloumnDtailC"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tcCloumnDtailXC"
                                align="center"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-if="item.prop == 'codeQty'"
                                            :disabled="scope.row['ifCodeReading'] != '1'"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            type='number'
                                            maxLength='9'
                                        />
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-else
                                            :placeholder="'请输入'+ item.label"
                                            size="mini"
                                            @change="inputChange(scope.row, item.prop)"
                                            type='number'
                                            maxLength='9'
                                        />
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="packingSpecificatClick($event, scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'packFormat'"
                                                   size="mini" placeholder="请选择规格">
                                            <el-option
                                                v-for="busi in hwGoodsList"
                                                :key="busi.id"
                                                :label="busi.packName"
                                                :value="busi.packFormat">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1" false-label="0"
                                                     @change="boxChange($event, item, scope.row)"></el-checkbox>
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
        </el-card>
        <el-card v-if="setPlan == '60' && (menuActiveName == 26 || menuActiveName == 37)" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApply.billOfLandingNo }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :data="keys.ccisSeparationApplyParents"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tjCloumnDtailC"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tjCloumnDtailXC"
                                align="center"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-if="item.prop == 'codeQty'"
                                            :disabled="scope.row['ifCodeReading'] != '1'"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            type='number'
                                            maxLength='9'
                                        />
                                        <el-input
                                            v-model.number='scope.row[item.prop]'
                                            v-else
                                            size="mini"
                                            @change="inputChange(scope.row, item.prop)"
                                            :placeholder="'请输入'+ item.label"
                                            type='number'
                                            maxLength='9'
                                        />
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="changesMatCode($event,scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]"  v-if="item.prop == 'matPack'"
                                                   size="mini" placeholder="请选择规格">
                                            <el-option
                                                v-for="busi in packingSpecificationList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1" false-label="0"
                                                     @change="boxChange($event, item, scope.row)"></el-checkbox>
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
        </el-card>
        <el-card v-if="setPlan == '60' && menuActiveName == 36" style="margin: 10px 0"
                 v-for="(keys, index) in tableData" :key="index">
            <div>
                <div style="display:flex;justify-content:space-between;font-size:16px;font-weight: 700;">
                    <div>箱号:{{ keys.ccisSeparationApply.businessItem }}</div>
                    <div>提单号:{{ keys.ccisSeparationApply.billOfLandingNo }}</div>
                </div>
                <div style="font-weight: 700;font-size:14px;">
                    <div>分色数据</div>
                    <div style="margin-bottom:20px;">
                        <el-table
                            :data="keys.ccisSeparationApplyParents"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in tjCloumnDtailC"
                                align="center"
                                :key="item.prop"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItems(scope.$index, keys.ccisSeparationApplyParents, index)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'date'" style="font-weight:300">
                                        {{ $utils.timestampToDate(scope.row[item.prop]) }}
                                    </div>
                                    <div v-else-if="item.type == 'isOne'" style="font-weight:300">
                                        {{ scope.row[item.prop] ? scope.row[item.prop] == '1' ? '一般贸易' : '保税' : '' }}
                                    </div>
                                    <div v-else style="font-weight:300">
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div>目标分色数据</div>
                    <div>
                        <el-button type="primary" size="mini" @click="createdKeys(keys)">新增</el-button>
                        <el-table
                            :data="keys.ccisSeparationApplyChilds"
                            :header-cell-style="{'font-weight': 300,'color': '#111'}"
                            style="width: 100%">
                            <el-table-column
                                v-for="item in shCloumnDtailX"
                                align="center"
                                :render-header="(h,obj) => addRedStar(h, obj, item.isWrited)"
                                :fixed="item.prop == 'operation'?'right' : false"
                                :key="item.prop"
                                :prop="item.prop"
                                :label="item.label"
                                :width="item.width">
                                <template slot-scope="scope">
                                    <div v-if="item.type == 'operation'">
                                        <el-button type="text" size="mini"
                                                   @click="deleteItem(scope.$index, keys.ccisSeparationApplyChilds)">
                                            <span style="color:#5c68ee">删除</span></el-button>
                                    </div>
                                    <div v-else-if="item.type == 'input'">
                                        <el-input v-model="scope.row[item.prop]" size="mini"
                                                  :placeholder="'请输入'+ item.label"></el-input>
                                    </div>
                                    <div v-else-if="item.type == 'number'">
                                        <el-input
                                            v-model='scope.row[item.prop]'
                                            v-if="item.prop == 'codeQty'"
                                            :disabled="scope.row['ifCodeReading'] != '1'"
                                            size="mini"
                                            :placeholder="'请输入'+ item.label"
                                            @change="inputChange(scope.row, item.prop)"
                                        />
                                        <el-input
                                            v-model='scope.row[item.prop]'
                                            v-else
                                            size="mini"
                                            @change="inputChange(scope.row, item.prop)"
                                            :placeholder="'请输入'+ item.label"
                                        />
                                    </div>
                                    <div v-else-if="item.type == 'select'">
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matTypCode'"
                                                   value="into" size="mini" placeholder="请选择品类"
                                                   @change="changesInfos($event,scope.row)">
                                            <el-option
                                                v-for="busi in categoryList"
                                                :key="busi.id"
                                                :label="busi.dictName"
                                                :value="busi.dictValue">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" v-if="item.prop == 'matCode'"
                                                   value="into" size="mini" placeholder="请选择品名"
                                                   @change="changesMatCode($event,scope.row)">
                                            <el-option
                                                v-for="busi in scope.row.matCodeList"
                                                :key="busi.id"
                                                :label="busi.matName"
                                                :value="busi.matCode">
                                            </el-option>
                                        </el-select>
                                        <el-select v-model="scope.row[item.prop]" disabled
                                                   v-if="item.prop == 'packFormat'"
                                                   size="mini" placeholder="请选择规格" filterable>
                                            <el-option
                                                v-for="busi in hwGoodsList"
                                                :key="busi.id"
                                                :label="busi.packName"
                                                :value="busi.packFormat">
                                            </el-option>
                                        </el-select>
                                    </div>
                                    <div v-else-if="item.type == 'date'">
                                        <el-date-picker
                                            v-model="scope.row[item.prop]"
                                            type="date"
                                            @change="dateChange(scope.row, item.prop)"
                                            clearable
                                            size="mini"
                                            placeholder="选择日期">
                                        </el-date-picker>
                                    </div>
                                    <div v-else-if="item.type == 'radio'">
                                        <el-checkbox v-model="scope.row[item.prop]" true-label="1" false-label="0"
                                                     @change="boxChange($event, item, scope.row)"></el-checkbox>
                                    </div>
                                    <div v-else>
                                        {{ scope.row[item.prop] }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <el-dialog
                        :visible.sync="sTargetColorSeparationData"
                        width="80%"
                        height="100%"
                        :before-close="handleClose"
>
                        <el-input v-model="matName" size="mini" placeholder="根据品名模糊查询" style="width:200px"></el-input>
                        <el-select v-model="cargoName" disabled placeholder="" size="mini">
                            <el-option>
                            </el-option>
                        </el-select>
                        <el-button type="primary" size="mini" @click="searchS(keys)" style="margin-left:10px">查询
                        </el-button>
                        <el-button type="primary" size="mini" @click="resetS(keys)">重置</el-button>
                        <el-table
                            :data="sColorSeparationData"
                            :height="300"
                            style="width: 100%"
                            @selection-change="sColorSeparationSelectHandler">
                            <el-table-column align="center" type="selection" width="80"></el-table-column>
                            <el-table-column align="center" type="index" width="80" label="编号"/>
                            <el-table-column
                                v-for="item in sCloumns"
                                align="center"
                                :key="item.prop"
                                :prop="item.prop"
                                :fixed="item.fixed"
                                :label="item.label"
                                :width="item.width">
                            </el-table-column>
                        </el-table>
                        <span slot="footer" class="dialog-footer" style="margin-bottom:10px">
                            <el-button @click="sTargetColorSeparationData = false" size="mini"
                                       style="float:right;position:relative;bottom:9px;right:40px;">取 消</el-button>
                            <el-button type="primary" @click="selectColorTrueHandler(keys)" size="mini"
                                       style="float:right;position:relative;bottom:9px;right:60px;">确 定</el-button>
                        </span>
                    </el-dialog>
                </div>
            </div>
        </el-card>
        <el-card style="margin: 10px 0">
            <attachment-model ref="attachmentRef" :url="`/api/wms_file/customerUpload`" :select-row.sync="selectRow"
                              :menu-active-name="menuActiveName" :wms-url="wmsUrl" @check-data="checkData"
                              @refresh-file-list="refreshFileList"/>
        </el-card>
    </div>
</template>

<script>
import {
    getStockListByOwnerCodeForLenglian,
    selectCustomerInfoByDto,
    createdSepPlanInfo,
    getCategoryInfo,
    getOwnerCodeListByStock,
    getBusinessInfos,
    packingSpecification,
    getFuzzyQuery
} from '@/api/planInfo';
import {
    getSepPlanDtails,
    getGoodsInfo,
    updataSepPlanInfo,
    createApplyAndApplyDetail,
    updateApplyAndApplyDetail,
    lenglianSelectDetailByOrderNum,
    addIntoMaterialData
} from '@/api/sepPlan';
import { getByCodeTableTypeList } from '@/api/bondedWarehous';
import _ from 'lodash';
import AttachmentModel from '@/view/component/attachment/index.vue';
import cmlLogin from '@/view/home/cmlLogin';

export default {
    name: 'setPlanInfo',
    components: {
        AttachmentModel
    },
    props: {
        menuActiveName: {
            type: String,
            default: ''
        },
        wmsUrl: {
            type: String,
            default: ''
        },
        orderItem: {
            type: Object,
            default: () => {
            }
        },
        wareList: {
            type: Object,
            default: () => {
            }
        },
        editItem: {
            type: Object,
            default: () => {
            }
        },
        editItemWarehousing: {
            type: Object,
            default: () => {
            }
        }
    },
    data() {
        return {
            complete: new Promise((resolve, reject) => {
                this.resolveComplete = resolve;
                this.rejectComplete = reject;
            }),
            selectCustomer: '',
            total: '',
            orderNum: '',
            status: '',
            outEstimateDate: '',
            outCarNo: '',
            outDriver: '',
            outTel: '',
            remark: '',
            searchTableData: {},
            value1: '',
            dialogVisible: false,
            matName: '',
            setPlan: '',
            fileList: [],
            countryCodeList: [],
            sepLoading: false,
            sTargetColorSeparationData: false,
            sColorSeparationData: [],
            listQuery: {
                ownerCode: '',
                matTypCode: '',
                businessItem: '',
                billOfLandingNo: '',
                matName: ''
            },
            setPlanList: [
                {
                    lable: '在库分色',
                    value: '61'
                },
                {
                    lable: '出库分色',
                    value: '60'
                },
            ],
            cloumns: [{
                prop: 'batchAttr07',
                label: '箱号',
                type: 'input',
                width: '200',

            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'goodsBondedProperty',
                label: '保税性质',
                type: 'isOne',
                width: '200',
                formatter: (row) => {
                    if (row.goodsBondedProperty == 2) {
                        return '保税';
                    } else if (row.goodsBondedProperty == 1) {
                        return '一般贸易';
                    } else {
                        return '';
                    }
                }
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '工厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200',
                formatter: (row) => {
                    return this.$utils.timestampToDate(row['dateGen']);
                }
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200',
                formatter: (row) => {
                    return this.$utils.timestampToDate(row['dateExpire']);
                }
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200',
                formatter: (row) => {
                    return this.$utils.timestampToDate(row['dateInto']);
                }
            }, {
                prop: 'totalQty',
                label: '总库存件数',
                type: 'input',
                fixed: 'right',
                width: '100'
            }, {
                prop: 'availableQty',
                label: '可分色件数',
                type: 'input',
                fixed: 'right',
                width: '100'
            }],
            sCloumns: [{
                prop: 'matCode',
                label: '商品料号',
                width: '200',
            }, {
                prop: 'matName',
                label: '品名',
                width: '200'
            }, {
                prop: 'whRecPreentNo',
                label: '提发货凭证编号',
                width: '200'
            }, {
                prop: 'specifications',
                label: '规格型号',
                width: '200',
            }, {
                prop: 'storageName',
                label: '商品储存方式',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '工厂号',
                width: '200'
            }],
            cloumnsTwo: [{
                prop: 'batchAttr07',
                label: '箱号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'goodsBondedProperty',
                label: '保税性质',
                type: 'isOne',
                width: '200',
                formatter: (row) => {
                    if (row.goodsBondedProperty == 2) {
                        return '保税';
                    } else if (row.goodsBondedProperty == 1) {
                        return '一般贸易';
                    } else {
                        return '';
                    }
                }
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '工厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'totalQty',
                label: '总库存件数',
                type: 'input',
                width: '100'
            }, {
                prop: 'availableQty',
                label: '分色件数',
                type: 'input',
                width: '100'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '70'
            }],
            cloumnsTJ: [{
                prop: 'batchAttr07',
                label: '箱号',
                type: 'input',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'goodsBondedProperty',
                label: '保税性质',
                type: 'isOne',
                width: '200',
                formatter: (row) => {
                    if (row.goodsBondedProperty == 2) {
                        return '保税';
                    } else if (row.goodsBondedProperty == 1) {
                        return '一般贸易';
                    } else {
                        return '';
                    }
                }
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '工厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'packageName',
                label: '规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'totalQty',
                label: '总库存件数',
                type: 'input',
                width: '100'
            }, {
                prop: 'availableQty',
                label: '可分色件数',
                type: 'input',
                width: '100'
            }],
            cloumnsTwoTJ: [{
                prop: 'batchAttr07',
                label: '箱号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'goodsBondedProperty',
                label: '保税性质',
                type: 'isOne',
                width: '200',
                formatter: (row) => {
                    if (row.goodsBondedProperty == 2) {
                        return '保税';
                    } else if (row.goodsBondedProperty == 1) {
                        return '一般贸易';
                    } else {
                        return '';
                    }
                }
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '工厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'packageName',
                label: '规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'totalQty',
                label: '总库存件数',
                type: 'input',
                width: '100'
            }, {
                prop: 'availableQty',
                label: '分色件数',
                type: 'input',
                width: '100'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '70'
            }],
            tcCloumnDtail: [{
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '货物规格',
                type: 'input',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '已选库存件数',
                type: 'input',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '已选库存重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'singleWeight',
                label: '平均单件重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'businessNum',
                label: '报关单号',
                type: 'input',
                width: '200'
            }, {
                prop: 'contractNo',
                label: '合同号',
                type: 'input',
                width: '200'
            }, {
                prop: 'shipName',
                label: '船名',
                type: 'input',
                width: '200'
            }, {
                prop: 'voyageNum',
                label: '航次',
                type: 'input',
                width: '200'
            }, {
                prop: 'batchNum',
                label: '批次号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tcCloumnDtailX: [{
                prop: 'matTypCode',
                label: '品类',
                type: 'select',
                width: '200'
            }, {
                prop: 'matCode',
                label: '品名',
                type: 'select',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'packFormat',
                label: '货物规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '计划分色件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '计划分色重量（KGS）',
                type: 'number',
                width: '200'
            }, {
                prop: 'ifCodeReading',
                label: '是否抄码',
                type: 'radio',
                width: '200'
            }, {
                prop: 'codeQty',
                label: '抄码件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'businessNum',
                label: '报关单号',
                type: 'input',
                width: '200'
            }, {
                prop: 'contractNo',
                label: '合同号',
                type: 'input',
                width: '200'
            }, {
                prop: 'shipName',
                label: '船名',
                type: 'input',
                width: '200'
            }, {
                prop: 'voyageNum',
                label: '航次',
                type: 'input',
                width: '200'
            }, {
                prop: 'batchNum',
                label: '批次号',
                type: 'input',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            shCloumnDtail: [{
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '货物规格',
                type: 'input',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '已选库存件数',
                type: 'input',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '已选库存重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'singleWeight',
                label: '平均单件重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            shCloumnDtailX: [{
                prop: 'matTypeName',
                label: '品类',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                width: '200'
            }, {
                prop: 'specifications',
                label: '货物规格',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '计划分色件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '计划分色重量（KGS）',
                type: 'number',
                width: '200'
            }, {
                prop: 'ifCodeReading',
                label: '是否抄码',
                type: 'radio',
                width: '200'
            }, {
                prop: 'codeQty',
                label: '抄码件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tjCloumnDtail: [{
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'packageName',
                label: '包装规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '已选库存件数',
                type: 'input',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '已选库存重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'singleWeight',
                label: '平均单件重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tjCloumnDtailX: [{
                prop: 'matTypCode',
                label: '品类',
                type: 'select',
                width: '200'
            }, {
                prop: 'matCode',
                label: '品名',
                type: 'select',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '包装规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '计划分色件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '计划分色重量（KGS）',
                type: 'number',
                width: '200'
            }, {
                prop: 'ifCodeReading',
                label: '是否抄码',
                type: 'radio',
                width: '200'
            }, {
                prop: 'codeQty',
                label: '抄码件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tcCloumnDtailC: [{
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '货物规格',
                type: 'input',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '已选库存件数',
                type: 'input',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '已选库存重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'singleWeight',
                label: '平均单件重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'businessNum',
                label: '报关单号',
                type: 'input',
                width: '200'
            }, {
                prop: 'contractNo',
                label: '合同号',
                type: 'input',
                width: '200'
            }, {
                prop: 'shipName',
                label: '船名',
                type: 'input',
                width: '200'
            }, {
                prop: 'voyageNum',
                label: '航次',
                type: 'input',
                width: '200'
            }, {
                prop: 'batchNum',
                label: '批次号',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateInto',
                label: '入库时间',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tcCloumnDtailXC: [{
                prop: 'matTypCode',
                label: '品类',
                type: 'select',
                width: '200'
            }, {
                prop: 'matCode',
                label: '品名',
                type: 'select',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'packFormat',
                label: '货物规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '计划分色件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '计划分色重量（KGS）',
                type: 'number',
                width: '200'
            }, {
                prop: 'ifCodeReading',
                label: '是否抄码',
                type: 'radio',
                width: '200'
            }, {
                prop: 'codeQty',
                label: '抄码件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'businessNum',
                label: '报关单号',
                type: 'input',
                width: '200'
            }, {
                prop: 'contractNo',
                label: '合同号',
                type: 'input',
                width: '200'
            }, {
                prop: 'shipName',
                label: '船名',
                type: 'input',
                width: '200'
            }, {
                prop: 'voyageNum',
                label: '航次',
                type: 'input',
                width: '200'
            }, {
                prop: 'batchNum',
                label: '批次号',
                type: 'input',
                width: '200'
            }, {
                prop: 'isOut',
                label: '是否出库',
                type: 'radio',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tjCloumnDtailC: [{
                prop: 'matTypName',
                label: '品类',
                type: 'input',
                width: '200'
            }, {
                prop: 'matName',
                label: '品名',
                type: 'input',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '包装规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'settlementCustomerName',
                label: '结算客户',
                type: 'input',
                width: '250'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'input',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '已选库存件数',
                type: 'input',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '已选库存重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'singleWeight',
                label: '平均单件重量（KGS）',
                type: 'input',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            tjCloumnDtailXC: [{
                prop: 'matTypCode',
                label: '品类',
                type: 'select',
                width: '200'
            }, {
                prop: 'matCode',
                label: '品名',
                type: 'select',
                width: '200'
            }, {
                prop: 'country',
                label: '国别',
                type: 'input',
                width: '200'
            }, {
                prop: 'factoryCode',
                label: '厂号',
                type: 'input',
                width: '200'
            }, {
                prop: 'matPack',
                label: '包装规格',
                type: 'select',
                width: '200'
            }, {
                prop: 'isOut',
                label: '是否出库',
                type: 'radio',
                width: '200'
            }, {
                prop: 'orderQty',
                label: '计划分色/出库件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'orderWeight',
                label: '计划分色/出库重量（KGS）',
                type: 'number',
                width: '200'
            }, {
                prop: 'ifCodeReading',
                label: '是否抄码',
                type: 'radio',
                width: '200'
            }, {
                prop: 'codeQty',
                label: '抄码件数',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateGen',
                label: '生产日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'validatePeriod',
                label: '保质期',
                type: 'number',
                width: '200'
            }, {
                prop: 'dateExpire',
                label: '失效日期',
                type: 'date',
                width: '200'
            }, {
                prop: 'operation',
                label: '操作',
                type: 'operation',
                width: '130'
            }],
            getSepInfoData: {
                filterList: [],
                filterName: [],
                stkCodeList: [],
                pageNum: 1,
                pageSize: 10,
                pageOptionsList: [
                    50,
                    100,
                    200
                ],
                searchKeyOrderType: null,
                sortList: [],
                searchKey: '',
                searchOwnerCode: '', //搜索指定货主
                searchManageCompanyCode: '', //搜索货主运营公司
                separationOrderNum: ''
            },
            goodsBondedPropertyList: [
                {
                    label: '一般贸易',
                    value: 1
                }, {
                    label: '保税',
                    value: 2
                }
            ],
            categoryList: [],
            matCodeList: [],
            packingSpecificationList: [],
            cargoOwner: '',
            cargoName: '',
            tableInfo: [],
            activeTableList: [],
            tableData: [],
            customerList: [],
            hwGoodsList: [],
            codeNum: 1,
            selectRow: null
        };
    },
    methods: {
        resolveComplete() {},
        rejectComplete() {},

        setPlanChange() {
            this.tableData = [];
            this.activeTableList = [];
        },
        changesInfos(e, row, num) {
            if (this.menuActiveName != 36) {
                getBusinessInfos({ matTypCode: e, ownerCode: this.cargoOwner }, this.$props.wmsUrl).then(res => {
                    this.$set(row, 'matCodeList', res.data.returnData);
                    if (num != 1) {
                        if (row.matCode) {
                            row.matCode = '';
                        }
                    }
                });
            }
        },
        boxChange(e, item, row) {
            if (item.label == '是否出库' && this.$props.menuActiveName == 27) {
                if (e == '1') {
                    this.tcCloumnDtailXC = [{
                        prop: 'matTypCode',
                        label: '品类',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'matCode',
                        label: '品名',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'country',
                        label: '国别',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'factoryCode',
                        label: '厂号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'packFormat',
                        label: '货物规格',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'orderQty',
                        label: '计划分色件数',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'orderWeight',
                        label: '计划分色重量（KGS）',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'ifCodeReading',
                        label: '是否抄码',
                        type: 'radio',
                        width: '200'
                    }, {
                        prop: 'codeQty',
                        label: '抄码件数',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'dateGen',
                        label: '生产日期',
                        type: 'date',
                        width: '200'
                    }, {
                        prop: 'validatePeriod',
                        label: '保质期',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'dateExpire',
                        label: '失效日期',
                        type: 'date',
                        width: '200'
                    }, {
                        prop: 'businessNum',
                        label: '报关单号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'contractNo',
                        label: '合同号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'shipName',
                        label: '船名',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'voyageNum',
                        label: '航次',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'batchNum',
                        label: '批次号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'isOut',
                        label: '是否出库',
                        type: 'radio',
                        width: '200'
                    }, {
                        prop: 'outQty',
                        label: '计划出库件数',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'outWeight',
                        label: '计划出库重量（KGS）',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'operation',
                        label: '操作',
                        type: 'operation',
                        width: '130'
                    }];
                    this.$set(row, 'outQty', row.orderQty);
                    this.$set(row, 'outWeight', row.orderWeight);
                } else {
                    this.tcCloumnDtailXC = [{
                        prop: 'matTypCode',
                        label: '品类',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'matCode',
                        label: '品名',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'country',
                        label: '国别',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'factoryCode',
                        label: '厂号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'packFormat',
                        label: '货物规格',
                        type: 'select',
                        width: '200'
                    }, {
                        prop: 'orderQty',
                        label: '计划分色件数',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'orderWeight',
                        label: '计划分色重量（KGS）',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'ifCodeReading',
                        label: '是否抄码',
                        type: 'radio',
                        width: '200'
                    }, {
                        prop: 'codeQty',
                        label: '抄码件数',
                        type: 'number',
                        width: '200'
                    }, {
                        prop: 'dateGen',
                        label: '生产日期',
                        type: 'date',
                        width: '200'
                    }, {
                        prop: 'validatePeriod',
                        label: '保质期',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'dateExpire',
                        label: '失效日期',
                        type: 'date',
                        width: '200'
                    }, {
                        prop: 'businessNum',
                        label: '报关单号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'contractNo',
                        label: '合同号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'shipName',
                        label: '船名',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'voyageNum',
                        label: '航次',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'batchNum',
                        label: '批次号',
                        type: 'input',
                        width: '200'
                    }, {
                        prop: 'isOut',
                        label: '是否出库',
                        type: 'radio',
                        width: '200'
                    }, {
                        prop: 'operation',
                        label: '操作',
                        type: 'operation',
                        width: '130'
                    }];
                }
            }
            if (item.label == '是否抄码') {
                if (e == 1) {
                    row.codeQty = _.cloneDeep(row.orderQty);
                } else {
                    row.codeQty = null;
                }
            }
        },
        Pagechange(page) {
            this.getSepInfoData.pageNum = page,
                this.sepPlanXZ('', page);
        },
        pageSizeChange(pageSize) {
            this.getSepInfoData.pageSize = pageSize;
            this.sepPlanXZ('', pageSize);
        },
        addRedStar(h, { column }, required) {
            if (this.menuActiveName == 36) {
                if (column.property == 'country' || column.property == 'matPack' || column.property == 'orderQty' || column.property == 'orderWeight' || column.property == 'matTypCode' || column.property == 'matCode') {
                    return [
                        h('span', { style: 'color: red' }, '*'),
                        h('span', ' ' + column.label)
                    ];
                } else {
                    return [
                        h('span', {}, column.label)
                    ];
                }
            } else {
                if (column.property == 'packFormat' || column.property == 'matPack' || column.property == 'orderQty' || column.property == 'orderWeight' || column.property == 'matTypCode' || column.property == 'matCode') {
                    return [
                        h('span', { style: 'color: red' }, '*'),
                        h('span', ' ' + column.label)
                    ];
                } else {
                    return [
                        h('span', {}, column.label)
                    ];
                }
            }

        },
        dateChange(row, prop) {
            if (prop == 'dateGen' || prop == 'validatePeriod') {
                if (row.validatePeriod) {
                    if (row.dateGen) {
                        let d = new Date(row.dateGen);
                        d.setMonth(d.getMonth() + parseInt(row.validatePeriod));
                        let dateExpire = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
                        // row.dateExpire = dateExpire;
                        this.$set(row, 'dateExpire', dateExpire);
                    }
                }
            }
        },
        inputChange(row, prop) {
            console.log(prop);
            if (prop == 'validatePeriod') {
                if (row[prop] < 1) {
                    row[prop] = 1;
                }
                this.dateChange(row, prop);
                // return
            }
            if (row[prop] < 1) {
                row[prop] = 1;
            }
            if (prop == 'orderQty' || prop == 'codeQty' || prop == 'outQty' || prop == 'availableQty' || prop == 'totalQty') {
                row[prop] = _.cloneDeep(row[prop].toFixed(0) * 1);
            }
            if (prop == 'orderWeight') {
                row[prop] = row[prop].toFixed(3) * 1;
            } else if (prop == 'singleWeight') {
                row[prop] = row[prop].toFixed(3) * 1;
            } else if (prop == 'outWeight') {
                row[prop] = row[prop].toFixed(3) * 1;
            }
            if (row['isOut'] == '1') {
                if (prop == 'orderQty') {
                    console.log(row.isOut, prop, 'isOutssss');
                    this.$set(row, 'outQty', row['orderQty']);
                }
                if (prop == 'orderWeight') {
                    this.$set(row, 'outWeight', row['orderWeight']);
                }
            }
        },
        sColorSeparationSelectHandler(selection) {
            this.selectColorData = _.cloneDeep(selection);
        },
        selectColorTrueHandler(keys) {
            this.selectColorData.forEach(item => {
                // item.matCode = item.matName;
                // item.matTypCode = item.matTypeName;
                // item['packFormat'] = item.specifications;
                keys.ccisSeparationApplyChilds.push(item);
            });
            this.sTargetColorSeparationData = false;
        },
        createdKeys(keys) {
            if (this.menuActiveName != 36) {
                keys.ccisSeparationApplyChilds.push({ validatePeriod: 1, codeQty:null});
            } else if (this.menuActiveName == 36) {
                this.sTargetColorSeparationData = true;
                if (this.matName == '') {
                    this.listQuery = {
                        ownerCode: this.cargoOwner,
                        matTypCode: '',
                        businessItem: keys.ccisSeparationApply.businessItem,
                        billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo
                    };
                } else {
                    this.listQuery = {
                        ownerCode: this.cargoOwner,
                        matTypCode: '',
                        businessItem: keys.ccisSeparationApply.businessItem,
                        billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo,
                        matName: this.matName
                    };
                }
                getFuzzyQuery(this.listQuery, this.wmsUrl).then(({ data }) => {
                    if (data.returnCode === 200) {
                        if (true) {
                            this.sColorSeparationData = data.returnData.filter(x => x.bgFlag === true);
                            this.sColorSeparationData.forEach(item => {
                                this.countryCodeList.forEach(items => {
                                    if (item.country == items.code) {
                                        item.country = items.codeName;
                                    }
                                });
                            });
                        }
                    }
                });
            }
        },
        searchS(keys) {
            if (this.matName == '') {
                this.listQuery = {
                    ownerCode: this.cargoOwner,
                    matTypCode: '',
                    businessItem: keys.ccisSeparationApply.businessItem,
                    billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo
                };
            } else {
                this.listQuery = {
                    ownerCode: this.cargoOwner,
                    matTypCode: '',
                    businessItem: keys.ccisSeparationApply.businessItem,
                    billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo,
                    matName: this.matName
                };
            }
            getFuzzyQuery(this.listQuery, this.wmsUrl).then(({ data }) => {
                if (data.returnCode === 200) {
                    if (this.bgFlag) {
                        this.sColorSeparationData = data.returnData.filter(x => x.bgFlag === true);
                        this.sColorSeparationData.forEach(item => {
                            this.countryCodeList.forEach(items => {
                                if (item.country == items.code) {
                                    item.country = items.codeName;
                                }
                            });
                        });
                    } else {
                        this.sColorSeparationData = data.returnData;
                        this.sColorSeparationData.forEach(item => {
                            this.countryCodeList.forEach(items => {
                                if (item.country == items.code) {
                                    item.country = items.codeName;
                                }
                            });
                        });
                    }
                }
            });
        },
        resetS(keys) {
            this.matName = '';
            if (this.matName == '') {
                this.listQuery = {
                    ownerCode: this.cargoOwner,
                    matTypCode: '',
                    businessItem: keys.ccisSeparationApply.businessItem,
                    billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo
                };
            } else {
                this.listQuery = {
                    ownerCode: this.cargoOwner,
                    matTypCode: '',
                    businessItem: keys.ccisSeparationApply.businessItem,
                    billOfLandingNo: keys.ccisSeparationApply.billOfLandingNo,
                    matName: this.matName
                };
            }
            getFuzzyQuery(this.listQuery, this.wmsUrl).then(({ data }) => {
                if (data.returnCode === 200) {
                    if (this.bgFlag) {
                        this.sColorSeparationData = data.returnData.filter(x => x.bgFlag === true);
                        this.sColorSeparationData.forEach(item => {
                            this.countryCodeList.forEach(items => {
                                if (item.country == items.code) {
                                    item.country = items.codeName;
                                }
                            });
                        });
                    } else {
                        this.sColorSeparationData = data.returnData;
                        this.sColorSeparationData.forEach(item => {
                            this.countryCodeList.forEach(items => {
                                if (item.country == items.code) {
                                    item.country = items.codeName;
                                }
                            });
                        });
                    }
                }
            });
        },
        confirmInfo() {
            if (this.activeTableList.length == 0) {
                this.$message.error('请选择数据后再确认');
                return;
            }
            this.activeTableList.forEach(item => {
                let b = false;
                if (this.tableData.length > 0) {
                    this.tableData.forEach(keys => {
                        keys.ccisSeparationApplyParents.forEach(x => {
                            if (item.filterUniqueCode == x.filterUniqueCode) {
                                b = true;
                                return;
                            }
                        });
                    });
                }
                if (!b) {
                    //  if(item.wmsBatchNum){
                    //    item.batchNum = item.wmsBatchNum
                    //  }
                    let separationApply = {
                        businessItem: item.batchAttr07,
                        businessType: this.setPlan,
                        billOfLandingNo: item.batchAttr08
                    };
                    let a = false;
                    if (this.tableData.length > 0) {
                        this.tableData.forEach(keys => {
                            keys.ccisSeparationApplyParents.forEach(x => {
                                if (item.batchAttr07 == x.batchAttr07 && item.batchAttr08 == x.batchAttr08) {
                                    a = true;
                                    keys.ccisSeparationApplyParents.push(item);
                                    return;
                                }
                            });
                        });
                    }
                    if (!a) {
                        this.tableData.push({
                            ccisSeparationApply: separationApply,
                            ccisSeparationApplyParents: [item],
                            ccisSeparationApplyChilds: []
                        });
                    }

                }
            });
            this.dialogVisible = false;
            // this.activeTableList = []
            this.tableInfo = [];
        },
        deleteItem(index, rows, show, row) {
            rows.splice(index, 1);
            if (show) {
                this.tableInfo.push(row);
            }
        },
        deleteItems(index, rows, Tableindex) {
            this.activeTableList.forEach((item, activeIndex) => {
                if (item.filterUniqueCode == rows[index].filterUniqueCode) {
                    this.deleteItem(activeIndex, this.activeTableList, true, item);
                }
            });
            rows.splice(index, 1);
            if (rows.length == 0) {
                this.tableData.splice(Tableindex, 1);
            }
        },
        tcTableInfoCreated(item, index) {
            this.activeTableList.push(item);
            this.tableInfo.splice(index, 1);
        },
        getLocalTime(n) {
            if (n) {
                return new Date(parseInt(n)).toLocaleString().replace(/年|月/g, '-').replace(/日/g, ' ');
            } else {
                return '';
            }
        },
        packingSpecificatClick(e, row) {
            row.matCodeList.forEach(item => {
                if (item.matCode == e) {
                    row.packageType = item.packageType;
                }
            });
            this.changesMatCode(e, row);
        },
        handleClose(done) {
            this.getSepInfoData = {
                filterList: [],
                filterName: [],
                stkCodeList: [],
                pageNum: 1,
                pageSize: this.getSepInfoData.pageSize,
                pageOptionsList: [
                    50,
                    100,
                    200
                ],
                searchKeyOrderType: null,
                sortList: [],
                searchKey: '',
                searchOwnerCode: '', //搜索指定货主
                searchManageCompanyCode: '', //搜索货主运营公司
                separationOrderNum: ''
            },
                this.searchTableData = {};
            done();
        },
        sepPlanXZ(event, page) {
            if (this.setPlan == '') {
                this.$message.error('请选择分色类型');
                return;
            }
            if (!this.selectCustomer) {
                this.$message.error('请选择货权方');
                return;
            }
            selectCustomerInfoByDto({ 'ccisCustomerCode': this.selectCustomer }, this.$props.wmsUrl).then(({ data }) => {
                this.cargoOwner = data.returnData[0].customerCode;
                this.cargoName = data.returnData[0].customerName;
                this.getOwnerCodeListByStock();
                let body = {
                    filterList: this.getSepInfoData.filterList,
                    filterName: this.getSepInfoData.filterName,
                    stkCodeList: this.getSepInfoData.stkCodeList,
                    pageNum: this.getSepInfoData.pageNum,
                    pageSize: this.getSepInfoData.pageSize,
                    pageOptionsList: this.getSepInfoData.pageOptionsList,
                    searchKeyOrderType: this.getSepInfoData.searchKeyOrderType,
                    sortList: this.getSepInfoData.sortList,
                    searchKey: this.getSepInfoData.searchKey,
                    searchOwnerCode: this.cargoOwner, //搜索指定货主
                    searchSettlementCustomer: this.getSepInfoData.searchSettlementCustomer, //搜索货主运营公司
                    separationOrderNum: this.getSepInfoData.separationOrderNum
                };
                body.filterList.push({
                    filterKey: 'supervisionStatus',
                    filterValue: '0'
                });
                if (page == undefined || page == '' || page == null) {
                    if (this.getSepInfoData.filterList.length > 3) {
                        this.getSepInfoData.pageNum = 1;
                        body.pageNum = 1;
                    }
                }
              body.stockQueryType = 'separate'
                getStockListByOwnerCodeForLenglian(body, this.wmsUrl).then(({ data }) => {
                    this.total = data.returnData.pageInfo.total;
                    data.returnData.pageInfo.list.forEach(item => {
                        item.dateGen = this.$utils.timestampToDate(item.dateGen);
                        item.dateExpire = this.$utils.timestampToDate(item.dateExpire);
                        item.dateInto = this.$utils.timestampToDate(item.dateInto);
                        if (this.menuActiveName == 27 || this.menuActiveName == 36) {
                            this.$set(item, 'matPack', item.packName);
                        } else {
                            this.$set(item, 'matPack', item.isBulkCargo);
                        }
                        this.$set(item, 'businessNum', item.batchAttr12);
                        this.$set(item, 'orderWeight', item.availableWeight);
                        if (this.menuActiveName != 37) {
                            this.$set(item, 'factoryCode', item.batchAttr11);
                            this.$set(item, 'country', item.batchAttr10);
                            this.$set(item, 'singleWeight', item.batchAttr09);
                        }
                        this.$set(item, 'contractNo', item.batchAttr13);
                        this.$set(item, 'shipName', item.batchAttr14);
                        this.$set(item, 'voyageNum', item.batchAttr16);
                        this.$set(item, 'orderQty', item.availableQty);
                    });
                    let arr = data.returnData.pageInfo.list;
                    this.activeTableList.forEach(item => {
                        arr = arr.filter(keys => keys.filterUniqueCode != item.filterUniqueCode);
                    });
                    arr.forEach(item => {
                        if (this.menuActiveName != 37) {
                            item.country = item.countryName;
                        }
                    });
                    this.tableInfo = arr;
                });
            });
            this.dialogVisible = true;
        },
        getOwnerCodeListByStock() {
            let body = {
                filterList: [
                    {
                        filterKey: 'whCode',
                        filterValue: ''
                    },
                    {
                        filterKey: 'ownerCode',
                        filterValue: this.cargoOwner
                    },
                    {
                        filterKey: 'supervisionStatus',
                        filterValue: '0'
                    }
                ],
                filterName: [],
                stkCodeList: [],
                pageNum: this.getSepInfoData.page,
                pageSize: this.getSepInfoData.pageSize,
                pageOptionsList: [
                    50,
                    100,
                    200
                ],
                searchKeyOrderType: null,
                sortList: [],
                searchKey: '',
                searchOwnerCode: this.cargoOwner,
                searchWhCode: '',
                searchSettlementCustomer: '',
                searchManageCompanyCode: '',
                outPlanOrderNum: ''
            };
            getOwnerCodeListByStock(body, this.$props.wmsUrl).then(({ data }) => {
                if (data.returnCode == 200) {
                    this.customerList = data.returnData;
                }
            });
        },
        getCargoOwner() {
            selectCustomerInfoByDto({ 'ccisCustomerCode': this.selectCustomer }, this.$props.wmsUrl).then(({ data }) => {
                this.cargoOwner = data.returnData[0].customerCode;
                this.cargoName = data.returnData[0].customerName;
                this.getOwnerCodeListByStock();
                this.getByCodeTableType();
            });
            getCategoryInfo(this.$props.wmsUrl).then(res => {
                this.$nextTick(() => {
                    this.categoryList = res.data.returnData;
                });
            });
            packingSpecification(this.$props.wmsUrl).then(({ data }) => {
                this.packingSpecificationList = data.returnData;
            });
            getGoodsInfo({}, this.$props.wmsUrl).then(res => {
                this.hwGoodsList = res.data.returnData;
            });
        },
        getSepPlanDtailsInfo(order) {
            getSepPlanDtails({
                dataSource: order.dataSource,
                orderNum: order.orderNum
            }, this.$props.wmsUrl).then(({ data }) => {
                this.orderNum = data.returnData.ccisSeparationApply.orderNum;
                this.setPlan = data.returnData.ccisSeparationApply.businessType;
                this.outEstimateDate = data.returnData.ccisSeparationApply.outEstimateDate;
                this.outCarNo = data.returnData.ccisSeparationApply.outCarNo;
                this.outDriver = data.returnData.ccisSeparationApply.outDriver;
                this.outTel = data.returnData.ccisSeparationApply.outTel;
                this.remark = data.returnData.ccisSeparationApply.remark;
                this.status = _.clone(data.returnData.ccisSeparationApply.status);
                if (data.returnData.ccisSeparationApply.fileList) {
                    this.selectRow = { fileList: data.returnData.ccisSeparationApply.fileList };
                }
                this.tableData.push(data.returnData);
                console.log(this.tableData);
                this.tableData.forEach(item => {
                    item.ccisSeparationApplyChilds.forEach(keys => {
                        this.countryCodeList.forEach(items => {
                            if (keys.country == items.code) {
                                keys.country = items.codeName;
                            }
                        });
                        if (this.menuActiveName == 36) {
                            keys.specifications = _.cloneDeep(keys.matPack);
                            keys['matTypeName'] = keys.matTypCode;
                        }
                        if (keys.ifCodeReading == 1) {
                            keys.ifCodeReading = true;
                        } else {
                            keys.ifCodeReading = false;
                        }
                        if (keys.isOut == 1) {
                            this.tcCloumnDtailXC = [{
                                prop: 'matTypCode',
                                label: '品类',
                                type: 'select',
                                width: '200'
                            }, {
                                prop: 'matCode',
                                label: '品名',
                                type: 'select',
                                width: '200'
                            }, {
                                prop: 'country',
                                label: '国别',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'factoryCode',
                                label: '厂号',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'packFormat',
                                label: '货物规格',
                                type: 'select',
                                width: '200'
                            }, {
                                prop: 'orderQty',
                                label: '计划分色件数',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'orderWeight',
                                label: '计划分色重量（KGS）',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'ifCodeReading',
                                label: '是否抄码',
                                type: 'radio',
                                width: '200'
                            }, {
                                prop: 'codeQty',
                                label: '抄码件数',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'dateGen',
                                label: '生产日期',
                                type: 'date',
                                width: '200'
                            }, {
                                prop: 'validatePeriod',
                                label: '保质期',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'dateExpire',
                                label: '失效日期',
                                type: 'date',
                                width: '200'
                            }, {
                                prop: 'businessNum',
                                label: '报关单号',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'contractNo',
                                label: '合同号',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'shipName',
                                label: '船名',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'voyageNum',
                                label: '航次',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'batchNum',
                                label: '批次号',
                                type: 'input',
                                width: '200'
                            }, {
                                prop: 'isOut',
                                label: '是否出库',
                                type: 'radio',
                                width: '200'
                            }, {
                                prop: 'outQty',
                                label: '计划出库件数',
                                type: 'number',
                                width: '200'
                            }, {
                                prop: 'outWeight',
                                label: '计划出库重量（KGS）',
                                type: 'number',
                                width: '200'
                            }, {
                                prop: 'operation',
                                label: '操作',
                                type: 'operation',
                                width: '130'
                            }];
                            keys.isOut = true;

                        } else {
                            keys.isOut = false;
                        }
                        this.changesInfos(keys.matTypCode, keys, 1);
                    });
                });
            });
        },
        getSelectDetailByOrderNum(order) {
            lenglianSelectDetailByOrderNum({
                dataSource: order.dataSource,
                orderNum: order.orderNum
            }, this.$props.wmsUrl).then(({ data }) => {
                this.setPlan = data.returnData.ccisSeparationApply.businessType;
                this.orderNum = data.returnData.ccisSeparationApply.orderNum;
                this.outEstimateDate = data.returnData.ccisSeparationApply.outEstimateDate;
                this.outCarNo = data.returnData.ccisSeparationApply.outCarNo;
                this.outDriver = data.returnData.ccisSeparationApply.outDriver;
                this.outTel = data.returnData.ccisSeparationApply.outTel;
                this.remark = data.returnData.ccisSeparationApply.remark;
                this.fileList = data.returnData.ccisSeparationApply.fileList;
                console.log(this.fileList);
                if (data.returnData.ccisSeparationApply.fileList) {
                    this.selectRow = { fileList: data.returnData.ccisSeparationApply.fileList };
                }
                data.returnData.ccisSeparationApplyParents.forEach(item => {
                    if (this.menuActiveName == 36||this.menuActiveName ==37) {
                        let obj = {
                            ccisSeparationApply: data.returnData.ccisSeparationApply,
                            ccisSeparationApplyParents: [item],
                            ccisSeparationApplyChilds: data.returnData.ccisSeparationApplyChilds
                        };
                        this.tableData.push(obj);
                    } else {
                        let obj = {
                            ccisSeparationApply: data.returnData.ccisSeparationApply,
                            ccisSeparationApplyParents: [item],
                            ccisSeparationApplyChilds: item.ccisSeparationApplyChilds
                        };
                        this.tableData.push(obj);
                    }
                });
                this.tableData.forEach(item => {
                    item.ccisSeparationApplyChilds.forEach(keys => {
                        if (keys.ifCodeReading == 1) {
                            keys.ifCodeReading = true;
                        } else {
                            keys.ifCodeReading = false;
                        }
                        if (keys.isOut == 1) {
                            keys.isOut = true;
                        } else {
                            keys.isOut = false;
                        }
                        this.changesInfos(keys.matTypCode, keys, 1);
                    });
                });
            });
        },
        cancelInfo() {
            this.dialogVisible = false;
            this.tableInfo = [];
            // this.activeTableList = []
        },
        cretedDataInfo(e) {
            try {
                this.sepLoading = true;
                if (!this.setPlan) {
                    this.$message({
                        message: '请选择分色类型！',
                        type: 'error'
                    });
                    this.sepLoading = false;
                    return;
                }
                let body = _.cloneDeep(this.tableData);
                if (body.length == 0) {
                    this.$message({
                        message: '请选择分色数据！',
                        type: 'error'
                    });
                    this.sepLoading = false;
                    return;
                }
                if (this.setPlan == '60') {
                    if (!this.outEstimateDate) {
                        this.$message({
                            message: '请选择预计提货日期！',
                            type: 'error'
                        });
                        this.sepLoading = false;
                        return;
                    }
                }
                let i = 0;
                // if (this.setPlan == '60') {
                //     body.forEach(item => {
                //         if (item.ccisSeparationApplyChilds.filter(item => item.isOut == '1').length == 0) {
                //             console.log('至少有一项选择出库');
                //             this.$message({
                //                 message: '至少有一项选择出库',
                //                 type: 'error'
                //             });
                //         }
                //     });
                // }
                // if (this.setPlan == '60' && i == 0) {
                //     console.log("this.setPlan == '60' && i == 0");
                //     return;
                // }
                if (this.$props.menuActiveName == 27) {
                    console.log('menuActiveName == 27');
                    let isOuts = true;
                    let isOuta = true;
                    body.forEach(keys => {
                        keys.orderNum = this.orderNum;
                        keys.businessItem = keys.batchAttr07;
                        keys.ccisSeparationApplyChilds.forEach(item => {
                            if (this.menuActiveName != 36) {
                                if (item.packFormat) {
                                    item.matPack = this.hwGoodsList.filter(x => x.packFormat == item.packFormat)[0].packName;
                                }
                            } else {
                                item['matPack'] = item.packFormat;
                            }
                            if (item.isOut == '1') {
                                if (!item.outQty) {
                                    isOuts = false;
                                }
                                if (!item.outWeight) {
                                    isOuts = false;
                                }
                                if (item.outQty && item.outQty > item.orderQty) {
                                    isOuta = false;
                                }
                            }
                            item.businessItem = keys.ccisSeparationApply.businessItem;
                            item.batchAttr07 = keys.ccisSeparationApply.businessItem;
                            if (item.ifCodeReading) {
                                item.ifCodeReading = 1;
                            } else {
                                item.ifCodeReading = 0;
                            }
                            if (item.isOut) {
                                item.isOut = 1;
                            } else {
                                item.isOut = 0;
                            }
                            if (item.dateGen) {
                                item.dateGen = this.$utils.timestampToDate(item.dateGen);
                            }
                            if (item.dateExpire) {
                                item.dateExpire = this.$utils.timestampToDate(item.dateExpire);
                            }
                        });
                        if (e != 1 && e != 0) {
                            this.status = this.status;
                        } else {
                            this.status = e;
                        }
                        keys.ccisSeparationApply.status = this.status;
                        keys.ccisSeparationApply.businessType = this.setPlan;
                        keys.ccisSeparationApply.cargoOwner = this.cargoOwner;
                        if (this.outEstimateDate) {
                            keys.ccisSeparationApply.outEstimateDate = this.$utils.timestampToDate(this.outEstimateDate);
                        }
                        keys.ccisSeparationApply.outCarNo = this.outCarNo;
                        keys.ccisSeparationApply.orderNum = this.orderNum;
                        keys.ccisSeparationApply.outDriver = this.outDriver;
                        keys.ccisSeparationApply.outTel = this.outTel;
                        keys.ccisSeparationApply.remark = this.remark;
                        keys.ccisSeparationApply.fileList = this.fileList;
                        if (keys.ccisSeparationApply.fileList.length > 0) {
                            keys.ccisSeparationApply.fileList.forEach(item => {
                                item['createUser'] = this.$utils.getUserInfo().realName;
                            });
                        }
                    });
                    if (!isOuts) {
                        this.$message({
                            message: '请输入出库信息',
                            type: 'error'
                        });
                        this.sepLoading = false;
                        return;
                    }
                    if (!isOuta) {
                        this.$message({
                            message: '出库分色件数不能大于计划分色件数',
                            type: 'error'
                        });
                        this.sepLoading = false;
                        return;
                    }
                    if (!this.$props.orderItem.orderNum) {
                        createdSepPlanInfo(body, this.$props.wmsUrl).then(({ data }) => {
                            if (data.returnCode == 200) {
                                this.$message({
                                    message: '数据保存成功！',
                                    type: 'success'
                                });
                                this.sepLoading = false;
                                // this.$router.go(-1)
                                this.$router.push({
                                    name: 'planInfo',
                                    query: {
                                        planNum: 4
                                    }
                                });
                            } else {
                                this.sepLoading = false;
                                this.$message({
                                    message: data.returnMsg,
                                    type: 'error'
                                });
                            }
                        });
                    } else {
                        updataSepPlanInfo(body[0], this.$props.wmsUrl).then(({ data }) => {
                            if (data.returnCode == 200) {
                                this.sepLoading = false;
                                this.$message({
                                    message: '数据保存成功！',
                                    type: 'success'
                                });
                                this.$router.push({
                                    name: 'planInfo',
                                    query: {
                                        planNum: 4
                                    }
                                });
                            } else {
                                this.sepLoading = false;
                                this.$message({
                                    message: data.returnMsg,
                                    type: 'error'
                                });
                            }
                        });
                    }

                } else if (this.$props.menuActiveName == 36) {
                    console.log('menuActiveName == 36');
                    if (!this.setPlan) {
                        this.$message({
                            message: '请选择分色类型！',
                            type: 'error'
                        });
                        this.sepLoading = false;
                        return;
                    }
                    let body = _.cloneDeep(this.tableData);
                    if (body.length == 0) {
                        this.$message({
                            message: '请选择分色数据！',
                            type: 'error'
                        });
                        this.sepLoading = false;
                        return;
                    }
                    if (this.setPlan == '60') {
                        if (!this.outEstimateDate) {
                            this.$message({
                                message: '请选择预计提货日期！',
                                type: 'error'
                            });
                            this.sepLoading = false;
                            return;
                        }
                    }
                    let i = 0;
                    if (this.setPlan == '60') {
                        body.forEach(item => {
                            console.log(i = item.ccisSeparationApplyChilds.filter(item => item.isOut == '1').length);
                            if (item.ccisSeparationApplyChilds.filter(item => item.isOut == '1').length == 0) {
                                this.$message({
                                    message: '至少有一项选择出库',
                                    type: 'error'
                                });
                            }
                        });
                    }
                    if (this.setPlan == '60' && i == 0) {
                        console.log(i, 'i');
                        return;
                    }
                    if (this.$props.menuActiveName == 36) {
                        let isOuts = true;
                        let isOuta = true;
                        body.forEach(keys => {
                            keys.orderNum = this.orderNum;
                            keys.businessItem = keys.batchAttr07;
                            keys.ccisSeparationApplyChilds.forEach(item => {
                                if (item.specifications) {
                                    item['matPack'] = item.specifications;
                                }
                                if (item.isOut == '1') {
                                    if (!item.outQty) {
                                        isOuts = false;
                                    }
                                    if (!item.outWeight) {
                                        isOuts = false;
                                    }
                                    if (item.outQty && item.outQty > item.orderQty) {
                                        isOuta = false;
                                    }
                                }
                                item.businessItem = keys.ccisSeparationApply.businessItem;
                                item.batchAttr07 = keys.ccisSeparationApply.businessItem;
                                if (item.ifCodeReading) {
                                    item.ifCodeReading = 1;
                                } else {
                                    item.ifCodeReading = 0;
                                }
                                if (item.isOut) {
                                    item.isOut = 1;
                                } else {
                                    item.isOut = 0;
                                }
                                if (item.dateGen) {
                                    item.dateGen = this.$utils.timestampToDate(item.dateGen);
                                }
                                if (item.dateExpire) {
                                    item.dateExpire = this.$utils.timestampToDate(item.dateExpire);
                                }
                            });
                            if (e == 1) {
                                this.status = e;
                            } else if (e == 0 && !this.status) {
                                this.status = e;
                            } else {
                                this.stautus = this.status;
                            }
                            keys.ccisSeparationApply.status = this.status;
                            keys.ccisSeparationApply.businessType = this.setPlan;
                            keys.ccisSeparationApply.cargoOwner = this.cargoOwner;
                            if (this.outEstimateDate) {
                                keys.ccisSeparationApply.outEstimateDate = this.$utils.timestampToDate(this.outEstimateDate);
                            }
                            keys.ccisSeparationApply.outCarNo = this.outCarNo;
                            keys.ccisSeparationApply.orderNum = this.orderNum;
                            keys.ccisSeparationApply.outDriver = this.outDriver;
                            keys.ccisSeparationApply.outTel = this.outTel;
                            keys.ccisSeparationApply.remark = this.remark;
                            keys.ccisSeparationApply.fileList = this.fileList;
                        });
                        if (!isOuts) {
                            this.$message({
                                message: '请输入出库信息',
                                type: 'error'
                            });
                            this.sepLoading = false;
                            return;
                        }
                        if (!isOuta) {
                            this.$message({
                                message: '出库分色件数不能大于计划分色件数',
                                type: 'error'
                            });
                            this.sepLoading = false;
                            return;
                        }
                        if (!this.$props.orderItem.orderNum) {
                            createdSepPlanInfo(body, this.$props.wmsUrl).then(({ data }) => {
                                this.sepLoading = false;
                                if (data.returnCode == 200) {
                                    this.$message({
                                        message: '数据保存成功！',
                                        type: 'success'
                                    });
                                    this.sepLoading = false;
                                    // this.$router.go(-1)
                                    this.$router.push({
                                        name: 'planInfo',
                                        query: {
                                            planNum: 4
                                        }
                                    });
                                } else {
                                    this.sepLoading = false;
                                    this.$message({
                                        message: data.returnMsg,
                                        type: 'error'
                                    });
                                }
                            });
                        } else {
                            updataSepPlanInfo(body[0], this.$props.wmsUrl).then(({ data }) => {
                                if (data.returnCode == 200) {
                                    this.sepLoading = false;
                                    this.$message({
                                        message: '数据保存成功！',
                                        type: 'success'
                                    });
                                    this.sepLoading = false;
                                    this.$router.push({
                                        name: 'planInfo',
                                        query: {
                                            planNum: 4
                                        }
                                    });
                                } else {
                                    this.sepLoading = false;
                                    this.$message({
                                        message: data.returnMsg,
                                        type: 'error'
                                    });
                                }
                            });
                        }
                    }
                } else {
                    console.log('else');
                    body.forEach(keys => {
                        keys.ccisSeparationApply.orderNum = this.orderNum;
                        keys.ccisSeparationApplyChilds.forEach(item => {
                            // item.matPack = item.packageName
                            item.businessItem = keys.ccisSeparationApply.businessItem;
                            item.batchAttr07 = keys.ccisSeparationApply.businessItem;
                            if (item.ifCodeReading) {
                                item.ifCodeReading = 1;
                            } else {
                                item.ifCodeReading = 0;
                            }
                            if (item.isOut) {
                                item.isOut = 1;
                            } else {
                                item.isOut = 0;
                            }
                            if (item.dateGen) {
                                item.dateGen = this.$utils.timestampToDate(item.dateGen);
                            }
                            if (item.dateExpire) {
                                item.dateExpire = this.$utils.timestampToDate(item.dateExpire);
                            }
                        });
                        if (e != 1 && e != 0) {
                            this.status = this.status;
                        } else {
                            this.status = e;
                        }
                        keys.ccisSeparationApply.status = this.status;
                        keys.ccisSeparationApply.businessType = this.setPlan;
                        keys.ccisSeparationApply.cargoOwner = this.cargoOwner;
                        if (this.outEstimateDate) {
                            keys.ccisSeparationApply.outEstimateDate = this.$utils.timestampToDate(this.outEstimateDate);
                        }
                        keys.ccisSeparationApply.outCarNo = this.outCarNo;
                        keys.ccisSeparationApply.outDriver = this.outDriver;
                        keys.ccisSeparationApply.outTel = this.outTel;
                        keys.ccisSeparationApply.remark = this.remark;
                        keys.ccisSeparationApply.fileList = this.fileList;
                    });
                    let obj = {
                        ccisSeparationApply: body[0].ccisSeparationApply,
                        ccisSeparationApplyParents: []
                    };
                    body.forEach(item => {
                        item.ccisSeparationApplyParents.forEach(keys => {
                            keys.ccisSeparationApplyChilds = item.ccisSeparationApplyChilds;
                            keys.businessItem = item.ccisSeparationApply.businessItem;
                            obj.ccisSeparationApplyParents.push(keys);
                        });
                    });
                    obj.ccisSeparationApplyParents[0].businessItem = obj.ccisSeparationApply.businessItem;
                    if (!this.$props.orderItem.orderNum) {
                        createApplyAndApplyDetail(obj, this.$props.wmsUrl).then(({ data }) => {
                            if (data.returnCode == 200) {
                                this.sepLoading = false;
                                this.$message({
                                    message: '数据保存成功！',
                                    type: 'success'
                                });
                                this.sepLoading = false;
                                this.$router.push({
                                    name: 'planInfo',
                                    query: {
                                        planNum: 4
                                    }
                                });
                            } else {
                                this.sepLoading = false;
                                this.$message({
                                    message: data.returnMsg,
                                    type: 'error'
                                });
                            }
                        });
                    } else {
                        updateApplyAndApplyDetail(obj, this.$props.wmsUrl).then(({ data }) => {
                            if (data.returnCode == 200) {
                                this.sepLoading = false;
                                this.$message({
                                    message: '数据保存成功！',
                                    type: 'success'
                                });
                                this.sepLoading = false;
                                this.$router.push({
                                    name: 'planInfo',
                                    query: {
                                        planNum: 4
                                    }
                                });
                            } else {
                                this.sepLoading = false;
                                this.$message({
                                    message: data.returnMsg,
                                    type: 'error'
                                });
                            }
                        });
                    }
                }
            } catch {
                this.sepLoading = false;
            }
        },
        getStockListByCCisCustomerCode() {
            this.getSepInfoData.filterList = [];
            this.getSepInfoData.searchSettlementCustomer = '';
            if (this.searchTableData.batchAttr07 !== '') {
                this.getSepInfoData.filterList.push({
                    filterKey: 'batchAttr07',
                    filterValue: this.searchTableData.batchAttr07
                });
            }
            if (this.searchTableData.settlementCustomer !== '') {
                this.getSepInfoData.searchSettlementCustomer = this.searchTableData['settlementCustomer'];
            }
            if (this.searchTableData.matName !== '') {
                this.getSepInfoData.filterList.push({ filterKey: 'matName', filterValue: this.searchTableData.matName });
            }
            if (this.searchTableData.matTypCode !== '') {
                this.getSepInfoData.filterList.push({
                    filterKey: 'matTypCode',
                    filterValue: this.searchTableData.matTypCode
                });
            }
            if (this.searchTableData.goodsBondedProperty !== '') {
                this.getSepInfoData.filterList.push({
                    filterKey: 'goodsBondedProperty',
                    filterValue: this.searchTableData.goodsBondedProperty
                });
            }
            this.sepPlanXZ();
        },
        changesMatCode(e, row) {
            let body = {
                ownerCode: this.cargoOwner,
                materialAndPacks: row.matCodeList.filter(item => item.matCode == e)
            };
            addIntoMaterialData(body, this.$props.wmsUrl).then(res => {
                console.log(res);
            });
            if (this.menuActiveName == 26 || his.menuActiveName == 37) {
                row.packageName = row.matCodeList.filter(item => item.matCode == e)[0].packageName;
                row.matPack = row.matCodeList.filter(item => item.matCode == e)[0].packageType;
            }
           /* if (this.menuActiveName == 37) {
                row.matName = row.matCodeList.filter(item => item.matCode == e)[0].matName;
            }*/
        },
        backToCancel() {
            this.$router.push({
                name: 'planInfo',
                query: {
                    planNum: 4
                },
                params: {
                    menuActiveName: this.$route.query.menuActiveName
                }
            });
        },
        checkData() {
            this.$refs.attachmentRef.showUpload();
        },
        refreshFileList(row, fileList) {
            this.fileList = fileList;
        },
        getByCodeTableType() {
            if (this.$props.menuActiveName == '36') {
                getByCodeTableTypeList(this.wmsUrl).then(({ data }) => {
                    this.countryCodeList = data.returnData.filter(item => {
                        return item.codeTableType == 'COUNTRY_CODE';
                    });
                    if (this.$props.orderItem && this.$props.orderItem.orderNum) {
                        if (this.$props.menuActiveName == 27 || this.$props.menuActiveName == 36) {
                            this.getSepPlanDtailsInfo(this.$props.orderItem);
                        } else {
                            this.getSelectDetailByOrderNum(this.$props.orderItem);
                        }
                    }
                });
            } else {
                if (this.$props.orderItem && this.$props.orderItem.orderNum) {
                    if (this.$props.menuActiveName == 27 || this.$props.menuActiveName == 36) {
                        this.getSepPlanDtailsInfo(this.$props.orderItem);
                    } else {
                        this.getSelectDetailByOrderNum(this.$props.orderItem);
                    }
                }
            }
        },
        onChangeCustomer() {
            this.getCargoOwner();
        }
    },
    async mounted() {
        if (this.$route.query.editItem) {
            this.$props.editItem = JSON.parse(this.$route.query.editItem);
        }
        this.$props.editItemWarehousing = JSON.parse(this.$route.query.editItemWarehousing);
        this.$props.menuActiveName = JSON.parse(this.$route.query.menuActiveName);
        this.$props.orderItem = JSON.parse(this.$route.query.orderItem);
        this.$props.wareList = JSON.parse(this.$route.query.wareList);
        this.$props.wmsUrl = JSON.parse(this.$route.query.wmsUrl);
        // this.getByCodeTableType();

        if (!this.$props.wmsUrl) {
          this.$props.wmsUrl = this.wareList.filter(item => item.id == this.$route.params.menuActiveName)[0].ipProt;
        }

        await this.complete;
        if (this.customerInfoList.length === 1) {
            this.selectCustomer = this.customerInfoList[0].customerPartyCode;
        }
        if (this.$props.orderItem && this.$props.orderItem.ccisCustomerCode) {
            this.selectCustomer = this.orderItem.ccisCustomerCode;
        }
        this.selectCustomer && this.getCargoOwner();

        if (this.menuActiveName == 36) {
            this.setPlan = '61';
        }
        // setTimeout(() => {
        //     this.getCargoOwner();
        // }, 500)
    },
    computed: {
        customerInfoList() {
            return this.$utils.getUserInfo().customerInfoList || [];
        }
    },
    watch: {
        '$store.state.user.userInfo': {
            handler(value) {
                if (!value || !value.entrustingPartyCode) return;
                this.resolveComplete();
            },
            deep: true,
            immediate: true
        }
    }
};
</script>

<style>
.titolItem {
    width: 40px;
    font-size: 14px;
    line-height: 27px;
}

.el-dialog__body {
    padding: 0px 20px;
    color: #606266;
    font-size: 14px;
    word-break: break-all;
}

.el-dialog__footer {
    padding: 30px 20px 30px;
    text-align: right;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
</style>
